package com.cryptape.cita_wallet.net.common;

import com.cryptape.cita_wallet.bean.BindHashBean;
import com.cryptape.cita_wallet.bean.CouldOrderBean;
import com.cryptape.cita_wallet.bean.CurrencyPrice;
import com.cryptape.cita_wallet.bean.LightNodeBean;
import com.cryptape.cita_wallet.bean.MarkIndexBean;
import com.cryptape.cita_wallet.bean.MiningOrderIncomeBean;
import com.cryptape.cita_wallet.bean.MiningWithdrawDetailBean;
import com.cryptape.cita_wallet.bean.MortgageAssociationBean;
import com.cryptape.cita_wallet.bean.MortgageMiningBean;
import com.cryptape.cita_wallet.bean.MyHMIOOrderBean;
import com.cryptape.cita_wallet.bean.MyMIDBean;
import com.cryptape.cita_wallet.bean.MyOrderWalletBean;
import com.cryptape.cita_wallet.bean.NetworkWideMortgageBean;
import com.cryptape.cita_wallet.bean.VStimulateBean;
import com.cryptape.cita_wallet.bean.VersionUpdateBean;
import com.cryptape.cita_wallet.net.response.BaseResponse;
import com.google.gson.JsonObject;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface RequestApi {

    /**
     * 社群
     * "address", string
     * "mid", string
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/content")
    Observable<JsonObject> associationContent(@Header("content") String content);

    /**
     * 节点首页
     * "address", string
     * "mid", string
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/node")
    Observable<JsonObject> getTokgetMangoNode(@Header("content") String content);

    /**
     * 持币生息首页
     * "address", string
     * "mid", string
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/order")
    Observable<JsonObject> geOrder(@Header("content") String content);

    /**
     * 挖矿抵押
     * "address", string
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/orderIndex")
    Observable<BaseResponse<MortgageMiningBean>> getOrderIndex(@Header("content") String content);

    /**
     * 社群
     * "address", string
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/mortgage")
    Observable<BaseResponse<MortgageAssociationBean>> getMortgage(@Header("content") String content);

    /**
     * 轻节点
     * "address", string
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/lightNode")
    Observable<JsonObject> getLightNode(@Header("content") String content);

    /**
     * 节点页面
     * "address", string
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/nodeIndex")
    Observable<BaseResponse<LightNodeBean>> getNodeIndex(@Header("content") String content);

    /**
     * 我的激励
     * "address", string
     * "limit", "100"
     * "page", "1"
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/myOrderWallet")
    Observable<BaseResponse<MyOrderWalletBean>> getMyOrderWallet(@Header("content") String content);

    /**
     * 指数
     * "address", string
     * "limit", "100"
     * "page", "1"
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/indexMarkIndex")
    Observable<BaseResponse<MarkIndexBean>> getIndexMarkIndex(@Header("content") String content);

    /**
     * 推送绑定
     * "address", string
     * "registrationId", registrationId
     * "status", status
     * "type", "1"
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/userRegistration/bindRegistration")
    Observable<BaseResponse> getBindRegistration(@Header("content") String content);

    /**
     * 推送全部检测
     * addrs : ["0xf4128a3E1da533C84A26a3Af5286c0ccF65EffD5","0xa9394dC32a995eCFBB664Fe6c0590b08CE2255C4","0x5960dCe7526AeF75CE41280620a81349b30b4ddC","0x0f19510bfE980555628Efbe796B9E7ACBf3B4026","0x84401351546088F8C517e93946de6C98D39Bb4c7","0xDbab2501164d73954A503216141a56e226F4E6bc"]
     * registrationId : 13165ffa4e8a58a6cb3
     * type : 0
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/userRegistration/allDetection")
    Observable<BaseResponse> getAllDetection(@Header("content") String content);

    /**
     * 备份MID用户
     * "address", address
     * "mid",  mid
     * "pMid", pMid
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/userBackup/user")
    Observable<JsonObject> getBackupMidUser(@Header("content") String content);

    /**
     * 转账记录
     * "hash", hash
     * "sender", sender
     * "receiver", receiver
     * "money", money
     * "type", type
     * "moneyType",  moneyType
     * "registrationId", CytonApplication.getInstance().registrationid
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/transactionRecord/save")
    Observable<BaseResponse> getTransferRecord(@Header("content") String content);

    /**
     * 保存当前语言
     * "registrationId", registrationId
     * "type",type 类型0英文(默认)1中文2日文3韩文
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/userAppLang/save")
    Observable<BaseResponse> saveCurrentLanguage(@Header("content") String content);

    /**
     * 获取当前语言
     * "registrationId", registrationId
     *
     * @param content content
     * @return type 类型0英文(默认)1中文2日文3韩文
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/userAppLang/lang")
    Observable<BaseResponse> getCurrentLanguage(@Header("content") String content);

    /**
     * 提取收益
     * "address", address
     * "moneyType", moneyType
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/order/withdraw/addOrder")
    Observable<BaseResponse> getAddOrder(@Header("content") String content);

    /**
     * 实时数据
     *
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/realTimeIndex")
    Observable<BaseResponse<NetworkWideMortgageBean>> getRealTimeIndex();

    /**
     * 提取收益首页
     * "address", address
     * "moneyType", moneyType
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/order/withdraw/withdrawIndex")
    Observable<BaseResponse<MiningWithdrawDetailBean>> getWithdrawIndex(@Header("content") String content);

    /**
     * 获取版本信息
     * "appType", "1"
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/api/appVersion/getVersion")
    Observable<BaseResponse<VersionUpdateBean>> getVersion(@Header("content") String content);

    /**
     * 获取我的云矿机
     * "address", address
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/order/myHMioOrders")
    Observable<BaseResponse<MyHMIOOrderBean>> getMyHMioOrders(@Header("content") String content);

    /**
     * 云矿机收益明细
     * "address", string
     * "limit", "100"
     * "page", "1"
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/order/miningOrderIncome")
    Observable<BaseResponse<MiningOrderIncomeBean>> getMiningOrderIncome(@Header("content") String content);

    /**
     * 绑定mid
     * "address", string
     * "parentMid", parentMid
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/bind")
    Observable<BaseResponse<MyMIDBean>> bindMid(@Header("content") String content);

    /**
     * 获取mid
     * "address", string
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/find")
    Observable<BaseResponse<MyMIDBean>> findMid(@Header("content") String content);

    /**
     * 获取云矿机
     * "address", string
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/order/couldOrder")
    Observable<BaseResponse<List<CouldOrderBean>>> getCouldOrder(@Header("content") String content);

    /**
     * 绑定地址
     * "fromAddress", fromAddress
     * "toAddress", toAddress
     * "hash", hash
     * "money", money
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/userCloudTransaction/add")
    Observable<BaseResponse> bindAddress(@Header("content") String content);

    /**
     * 获取V等级
     * "address", address
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/user/grade")
    Observable<BaseResponse<VStimulateBean>> getVGrade(@Header("content") String content);

    /**
     * 检测绑定地址
     * currentAddr：当前地址或账户名
     * type：1当前是eth 2当前是MGP
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/userTransactionRecord/checkstatus")
    Observable<BaseResponse> checkBind(@Header("content") String content);

    /**
     * 上传mgp转账记录
     * address:
     * num	:
     * hash:
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/api/chain/saveTransferHash")
    Observable<BaseResponse> saveTransferHash(@Header("content") String content);

    /**
     * 检测地址或账户名是否绑定
     * address:当前地址或用户名
     * bindAdress:绑定的地址或用户名
     * type:1mangoworld2mangowallet
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/userTransactionRecord/checkAddr")
    Observable<BaseResponse> checkAddr(@Header("content") String content);

    /**
     * 绑定地址
     * currentAddr：	 当前地址或者是用户名
     * bindAddr	：	 需要绑定的地址或用户名
     * hash	：	hash
     * type	：1mangoworld(绑定的是MGP)2mangowallet(绑定的是ETH)
     * money ： 金额
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/userTransactionRecord/add")
    Observable<BaseResponse> bindMgpChain(@Header("content") String content);

    /**
     * 查询币价地址
     * pair=MGP_USDT
     *
     * @param pair pair
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.QUERY_CURRENCY)
    @GET("/v1/q/ticker/price")
    Observable<BaseResponse<CurrencyPrice>> queryCurrency(@Query("pair") String pair);

    /**
     * 获取token ID
     *
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.TOKEN_ID)
    @GET("/v2/listings")
    Observable<String> getTokenId();

    /**
     * "address", bindAdress
     * "type", "2";1:ETH,2:MGP
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/userTransactionRecord/find")
    Observable<BaseResponse> isFindMIDBinding(@Header("content") String content);

    /**
     * addressbook
     * limit
     * page
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/api/chain/getSaveLog")
    Observable<BaseResponse<List<BindHashBean>>> getSaveLog(@Header("content") String content);

    /**
     * id 需要撤销的id
     *
     * @param content content
     * @return
     * @Header("content:") String content
     */
    @Headers("urlname:" + BaseUrlUtils.COMPANY_ADDRESS)
    @POST("/api/chain/resetSaveLog")
    Observable<BaseResponse> resetSaveLog(@Header("content") String content);
}
